home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat1 / nm.z / nm
Encoding:
Text File  |  1998-10-30  |  12.4 KB  |  331 lines

  1.  
  2.  
  3.  
  4. NNNNMMMM((((1111))))                                                                    NNNNMMMM((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      nm - print name list of an object file(s)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      nnnnmmmm [ ----bbbbddddeeeeffffgggghhhhllllnnnnoooopppprrrruuuuvvvvxxxxAAAABBBBCCCCTTTTVVVV ] [ files ]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      The _n_m command prints formatted listings of the symbol tables for each
  16.      ELF _f_i_l_e specified.  A _f_i_l_e can be a relocatable or absolute ELF object
  17.      file, or it can be an archive.
  18.  
  19.      _n_m produces different output formats depending on options and the binary
  20.      ABI.  The differences are an attempt to preserve the operation of scripts
  21.      that depend on nm.  Anyone desiring consistent operation across different
  22.      ABIs should use XPG4 format or Berkeley format.
  23.  
  24.      For old 32-bit-ABI objects the output format by default is the same as
  25.      IRIX5.2 and 5.3 (something like AT&T System V Release 3 format).
  26.  
  27.      For new 32-bit-ABI objects the output format by is AT&T System V Release
  28.      4 format.
  29.  
  30.      For 64-bit objects the output format is by default in AT&T System V
  31.      Release 4 format.
  32.  
  33.      If the environment variable _XPG is defined, _n_m operates in conformance
  34.      with the X/Open XPG4 specifications (called XXXXPPPPGGGG4444 mmmmooooddddeeee in this document).
  35.      The XPG4 mode format follows the XPG4 standards.  In XPG4 mode _n_m output
  36.      looks somewhat like nm -B (_B_e_r_k_e_l_e_y _s_t_y_l_e) _o_u_t_p_u_t.
  37.  
  38.      When Using AT&T System V Release 4 format the following information will
  39.      be printed for each symbol (an alternative, Berkeley (4.3BSD) format, is
  40.      described later in this document):
  41.  
  42.      IIIInnnnddddeeeexxxx   The index of the symbol. (The index appears in brackets.)
  43.  
  44.      VVVVaaaalllluuuueeee   The value of the symbol is one of the following: a section offset
  45.              for defined symbols in a relocatable file; alignment constraints
  46.              for symbols whose section index is SHN_COMMON; a virtual address
  47.              in executable and dynamic library files.
  48.  
  49.      SSSSiiiizzzzeeee    The size in bytes of the associated object.
  50.  
  51.      TTTTyyyyppppeeee    A symbol is one of the following types:  NNNNOOOOTTTTYYYYPPPPEEEE (no type was
  52.              specified), OOOOBBBBJJJJEEEECCCCTTTT (a data object such as an array or variable),
  53.              FFFFUUUUNNNNCCCC (a function or other executable code), SSSSEEEECCCCTTTTIIIIOOOONNNN (a section
  54.              symbol), or FFFFIIIILLLLEEEE (name of the source file).
  55.  
  56.      BBBBiiiinnnndddd    The symbol's binding attributes. LLLLOOOOCCCCAAAALLLL symbols have a scope
  57.              limited to the object file containing their definition; GGGGLLLLOOOOBBBBAAAALLLL
  58.              symbols are visible to all object files being combined; and WWWWEEEEAAAAKKKK
  59.              symbols are essentially global symbols with a lower precedence
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. NNNNMMMM((((1111))))                                                                    NNNNMMMM((((1111))))
  71.  
  72.  
  73.  
  74.              than _GGGG_LLLL_OOOO_BBBB_AAAA_LLLL.
  75.  
  76.      OOOOtttthhhheeeerrrr   A name scope indicator for (_r_l_d()).  One of _DDDD_EEEE_FFFF_AAAA_UUUU_LLLL_TTTT, _IIII_NNNN_TTTT_EEEE_RRRR_NNNN_AAAA_LLLL,
  77.              _HHHH_IIII_DDDD_DDDD_EEEE_NNNN, _PPPP_RRRR_OOOO_TTTT_EEEE_CCCC_TTTT_EEEE_DDDD.  (see STO_DEFAULT etc in <_s_y_s/_e_l_f._h>
  78.  
  79.      SSSShhhhnnnnddddxxxx   Except for  3 special values, this is the section header table
  80.              index in relation to which the symbol is defined.  The following
  81.              special values exist: AAAABBBBSSSS indicates the symbol's value will not
  82.              change through relocation; CCCCOOOOMMMMMMMMOOOONNNN indicates an unallocated block
  83.              and the value provides alignment constraints; and UUUUNNNNDDDDEEEEFFFF indicates
  84.              an undefined symbol.
  85.  
  86.      NNNNaaaammmmeeee    The name of the symbol.
  87.  
  88.      The _n_m command supports the options listed below.  NNNNOOOOTTTTEEEE:  The meaning of
  89.      ----oooo depends on whether ----AAAA(AT&T) or ----BBBB is in effect when  ----oooo is seen (the
  90.      meaning depends on the relative ordering of the options).  Examples:
  91.  
  92.        nm -Bo a.out
  93.        nm -oB a.out
  94.  
  95.      In the first example oooo is given the ----BBBB meaning, while in the second, it
  96.      is given the ----AAAA (default) meaning.
  97.  
  98.      ----AAAA      Use AT&T System V Release 4 format output. This is the default
  99.              for new 32-bit ABI objects and 64bit ABI objects. In XPG4 mode,
  100.              -A means write the full pathname of an object on each line.
  101.  
  102.      ----BBBB      Use Berkeley (4.3BSD) format output.  Overrides XPG4 mode.
  103.  
  104.      ----bbbb      Print the value field in octal.
  105.  
  106.      ----CCCC      Print decoded C++ names.
  107.  
  108.      ----dddd      Print the value field in decimal.  This is the default value
  109.              field radix for ----AAAA.
  110.  
  111.      ----eeee      Print externals and statics only.  This option applies to 32-bit
  112.              objects only and is ignored for 64-bit objects.
  113.  
  114.      ----ffff      Produce full output.  (This option is obsolete and does nothing
  115.              and will be removed in a future release).
  116.  
  117.      ----gggg      Print only globally-visible names.
  118.  
  119.      ----hhhh      Do not print headers.
  120.  
  121.      ----llll      Adds to the type field displayed in ----pppp format by printing a '*'
  122.              for weak names.  Has no effect on other formats or on ----BBBB format.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. NNNNMMMM((((1111))))                                                                    NNNNMMMM((((1111))))
  137.  
  138.  
  139.  
  140.      ----nnnn      When used alone or with ----AAAA, sort symbols by name.  By name is the
  141.              default sort order for ----BBBB.
  142.  
  143.              When used with ----BBBB, sort all symbols by value.
  144.  
  145.      ----oooo      When used alone or with ----AAAA, print the value field in octal.
  146.  
  147.              When used with ----BBBB, prepend the filename to output line.  This is
  148.              useful for _g_r_e_pping through _n_m of libraries.
  149.  
  150.      ----pppp      Produce easily parsable, terse output.
  151.  
  152.      ----rrrr      Prepend the name of the object file or archive to each output
  153.              line (Berkeley or XPG style) or name (ATT or default style).
  154.  
  155.      ----uuuu      Print only undefined symbols.
  156.  
  157.      ----vvvv      Sort symbols by value.
  158.  
  159.      ----xxxx      Print value field in hexadecimal.  This is the default value
  160.              field radix for ----BBBB.
  161.  
  162.      ----TTTT      Only applies to the 32-bit output format.  Truncate long names,
  163.              inserting a `*' as the last printed character.  (Since symbol
  164.              names have been moved to the last column, the problem of overflow
  165.              is removed and this option is no longer necessary.)
  166.  
  167.      ----VVVV      Print version information on standard error.
  168.  
  169.      ----PPPP      In XPG4 mode, write information in a portable output format
  170.              according to the XPG standard.
  171.  
  172.      ----tttt ffffoooorrrrmmmmaaaatttt
  173.              In XPG4 mode, write each numeric value in the specified format.
  174.              The format should be one of the following:
  175.                dddd The offset will be written in decimal.
  176.                oooo The offset will be written in octal.
  177.                xxxx The offset will be written in hexadecimal.
  178.  
  179. NNNNMMMM ----BBBB FFFFOOOORRRRMMMMAAAATTTT
  180.      For 32-bit objects _nnnn_mmmm _----_BBBB produces Berkeley output format with _a_d_d_r_e_s_s or
  181.      _v_a_l_u_e field followed by a _l_e_t_t_e_r showing what section the symbol is in
  182.      and the _n_a_m_e of the symbol.  Followed, if the symbol is a weak symbol, by
  183.      ((((wwwweeeeaaaakkkk)))).
  184.  
  185.      These section letters describe the information that _n_m generates:
  186.  
  187.           TTTT       External text.
  188.  
  189.           tttt       Local text.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. NNNNMMMM((((1111))))                                                                    NNNNMMMM((((1111))))
  203.  
  204.  
  205.  
  206.           DDDD       External initialized data.
  207.  
  208.           dddd       Local initialized data.
  209.  
  210.           BBBB       External zeroed data.
  211.  
  212.           bbbb       Local zeroed data.
  213.  
  214.           AAAA       External absolute.
  215.  
  216.           aaaa       Local absolute.
  217.  
  218.           UUUU       External undefined.
  219.  
  220.           GGGG       External small initialized data.
  221.  
  222.           gggg       Local small initialized data.
  223.  
  224.           IIII       Init section (IRIX4 static shared library initialization
  225.                   code).
  226.  
  227.           SSSS       External small zeroed data.
  228.  
  229.           ssss       Local small zeroed data.
  230.  
  231.           RRRR       External read only.
  232.  
  233.           rrrr       Local read only.
  234.  
  235.           CCCC       Common.
  236.  
  237.           EEEE       Small common.
  238.  
  239.      The following section letters were frequently emitted by _n_m in earlier
  240.      releases but are now rarely emitted.
  241.  
  242.           NNNN       Nil storage class, compiler internal usage.
  243.  
  244.           VVVV       External small undefined.
  245.  
  246.           bbbb       Fortran based variable
  247.  
  248.           XXXX       Exception data
  249.  
  250.           PPPP       Procedure section (not a normal variable).
  251.  
  252.           FFFF       Fini section.
  253.  
  254.           oooo       Non GP data item (item not put in a small data area even
  255.                   though it may be small enough to fit).
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. NNNNMMMM((((1111))))                                                                    NNNNMMMM((((1111))))
  269.  
  270.  
  271.  
  272. XXXXPPPPGGGG4444 mmmmooooddddeeee
  273.      In XPG4 mode the format is specified by the XPG4 standard. The output is
  274.      sorted alphabetically by symbol name. The following information is
  275.      output:
  276.  
  277.           Object  or library name, if -A is specified
  278.  
  279.           Name    Symbol name
  280.  
  281.           Type    Symbol type, which will be one of the following single
  282.                   characters (or one of the Berkeley format letters where
  283.                   non-conflicting with the following table).
  284.                                    A   Global absolute symbol
  285.                                    a   Local absolute symbol.
  286.                                    B   External zeroed data.
  287.                                    b   Local zeroed data.
  288.                                    D   Global data symbol.
  289.                                    d   Local data symbol.
  290.                                    T   Global text symbol.
  291.                                    t   Local text symbol.
  292.                                    U   Undefined symbol.
  293.  
  294.           Value   The value of the symbol.
  295.  
  296.           Size    The size of the symbol (0 if size not available).
  297.  
  298. NNNNOOOOTTTTEEEESSSS
  299.      In some previous releases the behavior of ----rrrrBBBB was very different from ----BBBBrrrr
  300.      (in this case the 'r' did nothing).  This did not appear to be
  301.      intentional and was certainly undocumented.  Now they both do the same
  302.      thing.
  303.  
  304. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  305.      collide(1), elfdump(1), dwarfdump(1), stdump(1), odump(1), nlist(3e)
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.